- Provide example uses of R with stormwater data
- Opine on strengths, weaknesses, perspectives
December 11, 2018
\(Estimate \approx (52 \ weeks)(10 \ years)(4 \ parameters)(100 \ sites)\) \(\approx \ 200,000 \ data \ points\) \(\approx \ 200,000 \ geometric \ means\) \(\approx \ 400,000 \ comparisons\)
Excel VBA Tool:
library(bacteria)
### Load and Clean Data Code
### Analyze Data
results <- bact_check(data, stations, "REC-1", "marine",
sub_ecoli_for_fecal = TRUE, six_week = FALSE)
exceeds <- bact_ann_exceeds(data, stations, "REC-1", "marine",
sub_ecoli_for_fecal = TRUE, six_week = FALSE)
### Plot Results Code
### Export Results Code
library(dygraphs)
library(dplyr)
library(readxl)
library(xts)
f319 <- read_excel("data/F319.xlsx")
f319 <- f319 %>%
dplyr::select(Date, Total) %>%
as.data.frame()
data <- xts(f319$Total, f319$Date)
dygraph(data, main = "Los Angeles River Flow Gage F319") %>%
dyAxis("y", label = "Flow (AF/day)") %>%
dyRangeSelector()
library(dplyr)
library(leaflet)
library(htmltools)
# Load File
filename <- "data/smarts_swapps_geninfo_2018-12-09.txt"
rb4 <- read.delim(filename, sep = "\t", stringsAsFactors = FALSE)
# Filter IGP Sites
rb4igp <- rb4 %>%
filter(PERMIT_TYPE == "Industrial") %>%
filter(STATUS == "Active")
# Plot Map Using Leaflet (code for labels omitted due to space)
leaflet(rb4igp) %>% addTiles() %>%
addCircles(lng = ~FACILITY_SITE_LONGITUDE, lat = ~FACILITY_SITE_LATITUDE,
opacity = 0.75, label = lapply(labs, HTML))
library(tabulizer) report <- "pdf/San Mateo trash RTAs 2006-07.pdf" lst <- extract_tables(report, encoding="UTF-8")
This is an R Markdown presentation. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
Chris Lopez Los Angeles Water Board Stormwater Permitting Unit chris.lopez@waterboards.ca.gov https://github.com/chrislopez28
(Credit: xkcd.com)